package org.lalib.controller.action;

import org.lalib.acquire.IControllerAction;
import org.lalib.command.CategoryCommand;
import org.lalib.command.CommandPageCommand;
import org.lalib.command.FoodCommand;
import org.lalib.command.OrderReportCommand;
import org.lalib.command.SearchCommand;
import org.lalib.command.TableCommand;
import org.lalib.command.UserCommand;
import org.lalib.command.UserGroupCommand;
import org.lalib.entity.object.EItem;
import org.lalib.util.LanguageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Scope("request")
@Controller("cMenuAction")
public class CMenuAction implements IControllerAction {

	private static final long serialVersionUID = 1L;

	@Autowired
	private LanguageUtil languageUtil;

	public String navigateToTable() {
		return new TableCommand().execute();
	}

	public String navigateToFood() {
		return new FoodCommand().execute();
	}

	public String navigateToSearch() {
		return new SearchCommand().execute();
	}

	public String navigateToUserGroup() {
		return new UserGroupCommand().execute();
	}

	public String navigateToUser() {
		return new UserCommand().execute();
	}

	public String navigateToCategory() {
		return new CategoryCommand().execute();
	}

	public String navigateToCommands(EItem item) {
		return new CommandPageCommand(item).execute();
	}

	public String navigateToOrderReport() {
		return new OrderReportCommand().execute();
	}

	public void changeLanguage(String language) {
		languageUtil.changeLanguage(language);
	}

	public String navigateToHome() {
		return "adminIndex";
	}
}
